/*
 * KTracker.h
 *
 *  Created on: May 29, 2009
 *      Author: flaviotruzzi
 */

#ifndef KTRACKER_H_
#define KTRACKER_H_

#include <cxcore.h>
#include <cv.h>

class KTracker {
 public:
  KTracker();
  void getContour(IplImage* src);
  void getOInfo();
  virtual ~KTracker();
  void predict();
  void correct();
  double getDistance();
  int getW();

  CvPoint massCenter;
  CvPoint measurePt;
  CvPoint massFilter;

 private:
  CvSeq* contour;
  CvSeq* contourtop;
  CvMoments Moment;
  CvMemStorage* storage;
  int numContour;
  double raioPixel;
  // proc_cov = process noise covariance value
  // meas_cov = measurement noise covariance value
  double xproc_cov;
  double xmeas_cov;
  double yproc_cov;
  double ymeas_cov;

  CvKalman* xkalman;
  CvKalman* ykalman;
  float A[9];
  CvRNG rng;
  CvMat* xmeasurement;
  CvMat* ymeasurement;
};

#endif /* KTRACKER_H_ */
